package com.adds.lvds.security.model;

import java.util.ArrayList;
import java.util.List;

public class SysRole {
	
	private Integer id;
	
	private Integer enable;

	private String name;
	
	private String roleKey;

	private String description;
	/**
	 * 角色等级， 等于数值越大表示权限越低
	 */
	private Integer role_level; 

	private List<SysResource> sysResources = new ArrayList<SysResource>();

	private List<SysCurrentUser> sysUsers = new ArrayList<SysCurrentUser>();

	public SysRole() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getEnable() {
		return enable;
	}

	public void setEnable(Integer enable) {
		this.enable = enable;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRoleKey() {
		return roleKey;
	}

	public void setRoleKey(String roleKey) {
		this.roleKey = roleKey;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	

	public Integer getRole_level() {
		return role_level;
	}

	public void setRole_level(Integer role_level) {
		this.role_level = role_level;
	}

	public List<SysResource> getSysResources() {
		return sysResources;
	}

	public void setSysResources(List<SysResource> sysResources) {
		this.sysResources = sysResources;
	}

	public List<SysCurrentUser> getSysUsers() {
		return sysUsers;
	}

	public void setSysUsers(List<SysCurrentUser> sysUsers) {
		this.sysUsers = sysUsers;
	}

	public String getResourcesName()
	{
		String resourcesName="";
		if(sysResources!=null&&sysResources.size()>0)
		{
			for (SysResource res : sysResources) {
				if(resourcesName.length()==0)
				{
					resourcesName=res.getName();
				}else
				{
					resourcesName=resourcesName+","+res.getName();
				}
			}
		}
		return resourcesName;
	}
	
	
}
